#!/bin/bash

# 检测kube-apiserver状态的脚本

SERVER_PORT=$1
if [ -n "$SERVER_PORT" ];then
	PORT_PROCESS=`ss -lnt | grep $SERVER_PORT | wc -l`
	if [ $PORT_PROCESS -eq 0 ];then
		echo "Port $SERVER_PORT is not used"
		exit 1
	fi
else
	echo "SERVER_PORT can not be empty"
fi
